﻿using System;
using System.Collections.Generic;

namespace CellDotNet.Cuda.DriverApi
{
	/// <summary>
	/// This maps CUresult.
	/// </summary>
	internal enum DriverStatusCode
	{
		CUDA_SUCCESS = 0,
		CUDA_ERROR_INVALID_VALUE = 1,
		CUDA_ERROR_OUT_OF_MEMORY = 2,
		CUDA_ERROR_NOT_INITIALIZED = 3,
		CUDA_ERROR_DEINITIALIZED = 4,

		CUDA_ERROR_NO_DEVICE = 100,
		CUDA_ERROR_INVALID_DEVICE = 101,

		CUDA_ERROR_INVALID_IMAGE = 200,
		CUDA_ERROR_INVALID_CONTEXT = 201,
		CUDA_ERROR_CONTEXT_ALREADY_CURRENT = 202,
		CUDA_ERROR_MAP_FAILED = 205,
		CUDA_ERROR_UNMAP_FAILED = 206,
		CUDA_ERROR_ARRAY_IS_MAPPED = 207,
		CUDA_ERROR_ALREADY_MAPPED = 208,
		CUDA_ERROR_NO_BINARY_FOR_GPU = 209,
		CUDA_ERROR_ALREADY_ACQUIRED = 210,
		CUDA_ERROR_NOT_MAPPED = 211,

		CUDA_ERROR_INVALID_SOURCE = 300,
		CUDA_ERROR_FILE_NOT_FOUND = 301,

		CUDA_ERROR_INVALID_HANDLE = 400,

		CUDA_ERROR_NOT_FOUND = 500,

		CUDA_ERROR_NOT_READY = 600,

		CUDA_ERROR_LAUNCH_FAILED = 700,
		CUDA_ERROR_LAUNCH_OUT_OF_RESOURCES = 701,
		CUDA_ERROR_LAUNCH_TIMEOUT = 702,
		CUDA_ERROR_LAUNCH_INCOMPATIBLE_TEXTURING = 703,

		CUDA_ERROR_UNKNOWN = 999
	}

	internal enum CUdevice_attribute
	{
		CU_DEVICE_ATTRIBUTE_MAX_THREADS_PER_BLOCK = 1,
		CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_X = 2,
		CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_Y = 3,
		CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_Z = 4,
		CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_X = 5,
		CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_Y = 6,
		CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_Z = 7,
		CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK = 8,
		[Obsolete("Use CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK.")]
		CU_DEVICE_ATTRIBUTE_SHARED_MEMORY_PER_BLOCK = 8,
		CU_DEVICE_ATTRIBUTE_TOTAL_CONSTANT_MEMORY = 9,
		CU_DEVICE_ATTRIBUTE_WARP_SIZE = 10,
		CU_DEVICE_ATTRIBUTE_MAX_PITCH = 11,
		CU_DEVICE_ATTRIBUTE_MAX_REGISTERS_PER_BLOCK = 12,
		[Obsolete("Use CU_DEVICE_ATTRIBUTE_MAX_REGISTERS_PER_BLOCK")]
		CU_DEVICE_ATTRIBUTE_REGISTERS_PER_BLOCK = 12,
		CU_DEVICE_ATTRIBUTE_CLOCK_RATE = 13,
		CU_DEVICE_ATTRIBUTE_TEXTURE_ALIGNMENT = 14,
		CU_DEVICE_ATTRIBUTE_GPU_OVERLAP = 15,
		CU_DEVICE_ATTRIBUTE_MULTIPROCESSOR_COUNT = 16
	}
}
